﻿using UnityEngine;
using System.Collections;

public class LoclRotation : MonoBehaviour {
	// Update is called once per frame
	void Update () {
        if(_isWork){
            transform.eulerAngles = _initAngles;
        }
    }

    private bool _isWork = false;
    private Vector3 _initAngles = Vector3.zero;

    public void LockEulerAngles(Vector3 angles) 
    {
        _isWork = true;
        _initAngles = angles;
    }

    public void UnLockEulerAngles()
    {
        _isWork = false;
    }
}
